
using System;
using System.Collections;
using System.Web.UI.WebControls;

using Awaken.Framework;
using Nullables;

namespace Awaken.CodeGen.Entities
{
    public partial class Project : IEntity
    {
        protected static ProjectBroker broker;
        public static ProjectBroker Broker
        {
            get
            {
                if (broker == null)
                {
                    broker = new ProjectBroker();
                }
                return broker;
            }
        }

        #region IEntity Members

        public string EntityID
        {
            get { return string.Empty; }
        }
        
        public string EntityName
        {
            get { return string.Empty; }
        }

        public void Save()
        {
            Broker.Save(this);
        }
        
        public void Delete()
        {
            Broker.Delete(this);
        }
        
        #endregion
    
        #region Constructor
        
        public Project()
        {
            // Default, no arg constructor.
        }
        
        #endregion
            
        #region Public Properties / Protected Fields
                        
        
        protected Guid? _ProjectID;
        public Guid? ProjectID
        {
            get{ return _ProjectID; }
            set{ _ProjectID=value; }
        }
        
        protected string _ProjectName;
        public string ProjectName
        {
            get{ return _ProjectName; }
            set{ _ProjectName=value; }
        }
        
        protected string _ConnectionString;
        public string ConnectionString
        {
            get{ return _ConnectionString; }
            set{ _ConnectionString=value; }
        }
        
        protected string _ClassDirectory;
        public string ClassDirectory
        {
            get{ return _ClassDirectory; }
            set{ _ClassDirectory=value; }
        }
        
        protected string _MappingDirectory;
        public string MappingDirectory
        {
            get{ return _MappingDirectory; }
            set{ _MappingDirectory=value; }
        }
        
        protected string _TestDirectory;
        public string TestDirectory
        {
            get{ return _TestDirectory; }
            set{ _TestDirectory=value; }
        }
        
        protected string _Namespace;
        public string Namespace
        {
            get{ return _Namespace; }
            set{ _Namespace=value; }
        }
        
        protected string _Assembly;
        public string Assembly
        {
            get{ return _Assembly; }
            set{ _Assembly=value; }
        }
        
        protected string _DatabaseName;
        public string DatabaseName
        {
            get{ return _DatabaseName; }
            set{ _DatabaseName=value; }
        }
        
        
        
        
                
        
        
        
        #endregion
    }
    
    #region ProjectBroker

    public partial class ProjectBroker : IBroker
    {
        #region IBroker Members

        public Type EntityType
        {
            get { return typeof(Project); }
        }
        
        public Project GetByID(object id)
        {
            return (Project)Awaken.Framework.Gateway.GetByID(EntityType, id);
        }

        public IList GetAll()
        {
            return Awaken.Framework.Gateway.GetAll(EntityType);
        }

        public void Save(IEntity entity)
        {
            Awaken.Framework.Gateway.Save(entity);
        }
        
        public void Delete(IEntity entity)
        {
            Awaken.Framework.Gateway.Delete(entity);
        }
        
        #endregion
    }
    #endregion
}
